package com.sunwayworld.basemodule.common.asynctask.comsumer.callback;

import com.sunwayworld.basemodule.common.asynctask.bean.LimsAsynctaskBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

//异步任务执行完毕后回调方法,打印log
@Service
@GikamBean
public class LoggerTaskExecuteCallback implements TaskExecuteCallback{
    private static final Logger logger = LogManager.getLogger(LoggerTaskExecuteCallback.class);

    @Override
    public void callBack(LimsAsynctaskBean asynctaskBean) {
        logger.info("异步任务执行回调,打印log,任务={},执行完毕,执行结果={},错误信息={}",asynctaskBean.getTaskId(),asynctaskBean.getExecStatus(),asynctaskBean.getErrMsg());
    }
}
